/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

.container-fluid {
    max-width: 1400px;
    padding: 0 20px;
}

/* 卡片样式 */
.card {
    border-radius: 10px;
    border: none;
    margin-bottom: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    border-bottom: none;
}

/* 传感器卡片样式 */
.sensor-card {
    display: flex;
    align-items: center;
    background-color: #fff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    height: 100%;
    transition: transform 0.3s;
}

.sensor-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.sensor-icon {
    font-size: 2rem;
    margin-right: 15px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #f8f9fa;
}

.sensor-data {
    flex-grow: 1;
}

.sensor-data h6 {
    margin: 0;
    color: #6c757d;
    font-weight: 600;
}

.sensor-data p {
    margin: 5px 0 0;
    font-size: 1.2rem;
    font-weight: bold;
}

/* 设备控制样式 */
.form-range {
    height: 8px;
}

.form-range::-webkit-slider-thumb {
    background: #0d6efd;
}

.form-range::-moz-range-thumb {
    background: #0d6efd;
}

.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* 设备控制卡片样式 */
.col-md-4 .card {
    position: sticky;
    top: 20px;
    height: calc(100vh - 150px);
    overflow-y: auto;
}

/* 日志容器样式 */
.log-container {
    background-color: #212529;
    border-radius: 5px;
    padding: 10px;
    height: 200px;
    overflow-y: auto;
}

.log-messages {
    font-family: 'Courier New', Courier, monospace;
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.5;
}

.log-messages .log-entry {
    margin-bottom: 5px;
    padding-left: 10px;
    border-left: 3px solid transparent;
}

.log-messages .log-info {
    border-left-color: #0dcaf0;
}

.log-messages .log-success {
    border-left-color: #198754;
}

.log-messages .log-warning {
    border-left-color: #ffc107;
}

.log-messages .log-error {
    border-left-color: #dc3545;
}

/* 连接状态样式 */
#connection-status {
    font-size: 0.9rem;
    padding: 5px 10px;
    transition: background-color 0.3s;
}

#connection-status.disconnected {
    background-color: #dc3545;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .sensor-card {
        margin-bottom: 15px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .sensor-icon {
        font-size: 1.5rem;
        width: 40px;
        height: 40px;
    }
    
    .sensor-data p {
        font-size: 1rem;
    }
    
    /* 移动设备上取消固定定位 */
    .col-md-4 .card {
        position: static;
        height: auto;
        overflow-y: visible;
    }
    
    /* 调整图表容器在移动设备上的高度 */
    canvas {
        max-height: 200px;
    }
}

/* 图表样式 */
canvas {
    max-height: 250px;
    width: 100% !important;
}

/* 图表容器样式 */
.col-md-6 {
    margin-bottom: 15px;
}

/* 传感器数据实时监控卡片样式 */
.card.shadow-sm.mb-4 .card-body {
    padding-bottom: 5px;
}

/* 按钮动画 */
.btn {
    transition: all 0.3s;
}

.btn:active {
    transform: scale(0.95);
}

/* 页脚样式 */
footer {
    border-top: 1px solid #dee2e6;
}